
function Request(){
    try {
        req = new ActiveXObject("MSXML2.XMLHTTP.3.0");
		return req;
    } 
    catch (e) {
    	req =  new XMLHttpRequest();
		return req; 
    }
}


req = Request();

function doneQuery(){
	
	if (req.readyState == 4) {
		if (req.status == 200) {
			document.getElementById("categorys").innerHTML = req.responseText;
		}
		else
		{
			document.getElementById("categorys").innerHTML = req.status+" 未找到分类信息";
		}
	}
	else {
		document.getElementById("categorys").innerHTML = "loading...";
	}
}
function getCategorys(blog)
{
	document.getElementById("blog").value = blog;
	req.onreadystatechange =doneQuery;
	req.open("GET", "/wordpress/getCategorys?blog="+blog, false);
	req.send();
	//document.getElementById("categorys").innerHTML = req.responseText;
}



function selectCategorys(cat)
{
	cats = document.getElementById("cat");
	//if(cats.value)
	//{
	//	if(cats.value.indexOf(cat)!=-1)
	//		return;
	//	cats.value +=","+cat
	//}
	//else
	cats.value = cat;
}
